ClutterImage as is, is very basic and doesn't really serve any purposes
other than being inherited by StImageContent. As we cannot easily push
ImageContent to Mutter by merging it with ClutterImage because it will
bring more GdkPixbuf usages and also because Clutter doesn't really deal
with theming bits.
Instead, merge it with StImageContent and let GNOME Shell take over from
here.
Florian Müllner [Fri, 29 Nov 2024 17:00:29 +0000 (18:00 +0100)]
tools/toolbox: Document new sysext tooling
Add a small section to outline how to combine `meson-build.sh --sysext` and
`toolbox-sysext-install.sh` to install a system extension from our toolboxes.
The new command will take an extension directory set up
with `meson-build --sysext` inside a toolbox, and turn
it into a merged system extension on the host.
Namely it will
1. copy the extension directory from the container to the host
2. set up the extension-release file expected by systemd-sysext
3. compile gsettings schemas if necessary (using the merged
schemas directory)
4. install the extension to either runtime or system
5. merge the extension
Florian Müllner [Tue, 8 Oct 2024 22:44:23 +0000 (00:44 +0200)]
tools/toolbox: Install sysext dependencies if necessary
While the toolbox image itself has all necessary dependencies to
build and run the shell, we still need them in the destdir when
building a system extension.
Achieve this by running .gitlab-ci/install-common-dependencies.sh
if it exists, which is the script that is used both for gnome-os
system extensions and mutter's CI image.
We will later add a separate command to extract the directory
from the container and turn it into a system extension suitable
for use with systemd-sysext.
Florian Müllner [Fri, 29 Nov 2024 16:54:32 +0000 (17:54 +0100)]
ci: Change `update-mutter` to also install to sysext dir
Out development toolbox contains an `update-mutter` command to
make it easier to keep mutter up-to-date for people who only
want to deal with gnome-shell.
To allow them to make use of the new sysext tooling, change the
command to install both to the toolbox root and the sysext
directory.
Florian Müllner [Fri, 4 Oct 2024 16:19:58 +0000 (18:19 +0200)]
ci: Make --destdir option in install-meson-project cumulative
When building a system extension for GNOME OS, any extra
dependencies are needed both in the container (for building)
and the extension's destdir (for running).
Because of that, the --destdir flag that was added in commit 8aeb6dc86 does not only install to the specified directory
as expected, but also runs a second install step without
destdir (i.e. to the system).
However that behavior is not a good fit when we extend our
existing toolbox tooling to build system extensions for
Fedora instead of GNOME OS.
To account for that, make the --destdir option cumulative
and install the project to all provided destdirs (or /
if omitted).
This gives us the flexibility to install to the system, a
different destdir, or both:
```
$ ./install-meson-project.sh # install to system
$ ./install-meson-project.sh --destdir /new/dest # install to destdir
$ ./install-meson-project.sh --destdir /new/dest --destdir / # both
```
Florian Müllner [Fri, 29 Nov 2024 13:55:56 +0000 (14:55 +0100)]
data: Really strip .desktop suffix from folder directory
Commit 730fcf34e9 was meant to strip the .desktop suffix from the
desktop directory file, but failed to actually do so: The replace()
method is called on the string parameter before it is passed to
the meson command which substitutes `@BASENAME@`, so it doesn't
have any effect at all.
Really fix the issue by providing the full output name.
Philip Withnall [Thu, 28 Nov 2024 10:41:13 +0000 (10:41 +0000)]
ci: Temporarily allow build-sysext CI job to fail
GitLab is currently timing out a lot, and the number of consecutive `git
clone` operations which the `build-sysext` job does is basically
guaranteed to fail at some point. I’ve tried one CI run 30 times in a
row without success.
Temporarily allow this job to fail until GitLab is fixed.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3251>
Philip Withnall [Mon, 4 Mar 2024 16:13:53 +0000 (16:13 +0000)]
breakManager: Add new state machine for screen time/health breaks
This implements health break reminder support in gnome-shell. It depends
on a
few bits and bobs from other modules:
- New settings schemas in gsettings-desktop-schemas (released in
47.beta, which Mutter already depends on)
- A settings UI in gnome-control-center
- User documentation in gnome-user-docs
It implements the design from
https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png.
The core of the implementation is `BreakManager`, which is a state
machine which uses the Mutter `IdleMonitor` to track whether the user
is, or should be, in a screen time break.
The `BreakDispatcher` is based on top of this, and controls showing
notifications, countdown timers, screen fades, the lock shield, etc. to
make the user aware of upcoming or due breaks, as per their notification
preferences.
Unit tests are included to check that `BreakManager` works. These
provide mock implementations of basic GLib clock functions, the
`IdleMonitor` and `Gio.Settings` in order to test the state machine in
faster-than-real-time.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
See: https://gitlab.gnome.org/Teams/Design/initiatives/-/issues/130
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3251>
Philip Withnall [Tue, 28 May 2024 17:03:11 +0000 (18:03 +0100)]
messageTray: Add removeAction() method and allow references to actions
Internally in gnome-shell it may be useful to modify the actions
available on a notification while it’s still visible, but without
clearing them all and re-creating them.
Allow that by returning the action object when adding it, and adding a
`removeAction()` method which takes that object and removes it.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3251>
Jonas Dreßler [Sun, 17 Nov 2024 18:28:35 +0000 (19:28 +0100)]
keyboard: Switch back from shift to default level on more situations
If the shift key was pressed, we should switch back to the default level
after the next commit. It seems that this only worked due to a superfluous
signal emission so far (see https://gitlab.gnome.org/GNOME/mutter/-/issues/3448).
When the keyboard is in this "shift" level (note: only "shift", not
"opt+shift" level) without being latched, there are certain events that
should put it back into the default level:
- A normal character key on the OSK being pressed
- A keyval on the extended OSK (eg. TAB key or an arrow key) being pressed
- The backspace key being pressed
- The OSK being hidden
- The user moving focus in the entry
The `_updateLevelFromHints()` function already takes care of updating the
active level after certain kinds of events, we can achieve the desired
behavior by adding a fallback case to that function where it moves the level
back from "shift" to "default".
Since we only want this switch back to the "default" layer as a response to
actual user input, add a `userInputHappened` boolean to
`_updateLevelFromHints()` and don't set that when the application simply
changes its content hints.
Jonas Dreßler [Sun, 17 Nov 2024 18:16:58 +0000 (19:16 +0100)]
keyboard: Don't press and release keyval if it's a modifier key
Looks like we currently do the press-and-release dance for keys that specify
both a keyval and the "modifier" action. So when pressing CTRL in the
extended OSK, not only is the CTRL modifier set together with the next key
pressed, but the actual CTRL keyval quickly gets pressed and released,
similar to how we'd do it for the TAB key.
This seems unintentional, as the press-and-release behavior should probably
be specific to keys like TAB, and not apply to modifier keys, so limit that
behavior to only keys without an action specified.
Jonas Dreßler [Sun, 17 Nov 2024 18:01:23 +0000 (19:01 +0100)]
keyboard: Don't check for key.action using strict equality operator
A lot of keys have no action set. In that case key.action is `undefined`,
but the strict equality check of `action !== null` here will return true and
we'll enter the if-case anyway.
That's quite confusing and was not intended like that, so change the
comparison to a less-strict operator.
Jonas Dreßler [Sun, 17 Nov 2024 19:17:23 +0000 (20:17 +0100)]
osk-layouts: Always use "delete" action for backspace in extended layouts
The extended-us layout is currently using actions/keyvals inconsistently for
its backspace keys, use the "delete" action consistently, just like we do in
all other OSK layouts (including the newly added za-extended layout).
Whenever you’re describing a function that takes a callback, you
should always annotate the callback argument with the argument that
contains the user data using the (closure argument) annotation
You should not annotate the data argument with a unary (closure).
The unary (closure) is meant to be used when annotating the callback
type
Recently gobject-introspection became a bit more strict with this and
that generated some warnings:
Warning: St: invalid "closure" annotation: only valid on callback
parameters
magnifier: Use the new get_client_content_rect API
As we have removed is_client_decorated from Mutter in the last release.
Instead of re-adding it and re-exposing SSD/CSD differences and making
gnome-shell deal with that, we created a new API that does exactly what
is_client_decorated was used for, so switch to using that.
data: Add X-GNOME-Shell-Utilities.directory file to allow showing real name
Instead of having the name of the directory be X-GNOME-Utilities. This
also allows translating the name to the user's language. The name is
chose to be different to X-GNOME-Utilities from GNOME Menus.
In the process, also remove the categories. The menu definition from
gnome-menus is not used, and it's not a category that apps list
themselves, so it's completely unused anyway.
Florian Müllner [Mon, 21 Oct 2024 21:23:29 +0000 (23:23 +0200)]
shell/plugin: Stop implementing plugin_info()
The hook would be optional if anything called `meta_plugin_get_info()`,
except that nothing has done so for the last ten years.
It seems a bit pointless to export information that is completely
unused, in particular as we never updated it ("version 0.1"?!),
so just stop doing that.
Sebastian Keller [Mon, 21 Oct 2024 19:53:14 +0000 (21:53 +0200)]
st/theme-node-drawing: Don't skip square top left inset shadow corners
When the inner radius of the top left corner is 0, the corresponding arc
does not get drawn, resulting in a path going from the bottom left
corner to the top right corner when the path is closed.
Fix this by always including a line_to from the bottom left to the top
left corner.
Fixes: dde13b30c ("st/theme-node-drawing: Trace the correct path for inset box shadows") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7996
Florian Müllner [Mon, 21 Oct 2024 00:33:33 +0000 (02:33 +0200)]
build: Do not require appstream-util for metainfo version check
appstream-util is deprecated in favor of appstreamcli. The new tool
does not have a `validate-version` command, so implement the check
in directly in the check-version.py script.
Florian Müllner [Fri, 18 Oct 2024 11:46:07 +0000 (13:46 +0200)]
style: Restore password entry width harder
Commit ee0538807 restored the fixed password entry width, but only
for entries nested under .prompt-dialog-password-layout. That
does not include the network secret dialog, so go back to the
original styling prior to commit 8d065b558e where the width
is set for all password entries, and the mount operation overrides
it with a more specific rule.
Florian Müllner [Thu, 17 Oct 2024 17:34:13 +0000 (19:34 +0200)]
style: Restore password entry width
Commit removed the fixed width that is used by polkit/keyring
prompts, with the result that the entries now start at their
natural size, and grow as text is entered.
Restore the original behavior, but nest the style under
.prompt-dialog-password-layout (polkit/keyring) to better
differentiate it from entries under ..prompt-dialog-password-grid
(mount operations).
Fixes: 8d065b558e ("style: Clean up dialogs stylesheet to fix layout issues")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3511>
Sam Hewitt [Mon, 16 Sep 2024 14:44:44 +0000 (12:14 -0230)]
style: Clean up dialogs stylesheet to fix layout issues
- remove unnecessary dialog type-specific padding, spacing and margin definitions that led to layout to problems
- bump the size of user avatar in authentication dialog
- nest css classes in the sass to better reflect the structure of dialog elements
- sync style of audio device selector with switcher-popup style
- sync text and padding styles with other elements
- fix incorrect button order in audio selection dialog
Florian Müllner [Thu, 20 Jun 2024 18:46:18 +0000 (20:46 +0200)]
extensionUtils: Include arrays and objects in serialization
We currently only handle simple types when (de)serializing,
which means we miss keys like "shell-version" and "session-modes".
While there is no immediate use for those, handing arrays and
objects will allow to support the newly added "donate" metadata
in the Extensions app in the future.
Guacamolie [Sun, 13 Oct 2024 13:52:44 +0000 (15:52 +0200)]
js: Update Meta.KeyHandlerFunc arguments
The Meta keybinding API now exposes the Clutter event to GJS, which was
previously hidden due to it being a gpointer. Since this moves the
binding argument one argument to the right on the GJS side, any code
that was using the binding argument needs to be updated.
Florian Müllner [Fri, 11 Oct 2024 12:30:44 +0000 (14:30 +0200)]
status/keyboard: Always released held keyboard after activating source
As the keyboard is released asynchronously after setting the ibus
engine, there's a possibility that the `this._reloading` property
changed in the meantime.
To ensure that `holdKeyboard()` and `releaseKeyboard()` are correctly
paired, record the condition in a local variable so that it maintains
its value in the callback.
status/keyboard: Fix execution order when activating source
When commit ce89b15bb123d made the code async, it did not only
delay releasing the keyboard until after the engine has been
updated, but also the following code that updates the current
input source.
One result is that the current source is now initialized later,
which breaks any code that relies on the source being set.
This affects the login screen in particular (which uses different
`InputSourceSettings` than the regular session): It fails to come
up entirely if the OSK is enabled.
To fix the issue, use a .then() callback to release the keyboard,
instead of blocking all following code with await.
Fixes: ce89b15bb1 ("ibusManager: Use async await instead of callbacks") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7912
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3476>
Florian Müllner [Fri, 4 Oct 2024 11:24:46 +0000 (13:24 +0200)]
tools/toolbox: Skip install step with --dist
The dist command only needs an up-to-date build directory, it
does not require the project to be installed first.
While the install step is generally quick, leaving the container
file system alone can save a rebuild after the dist is done
(for instance when testing a branch, then temporarily switching
to the release branch for dist).
Florian Müllner [Fri, 4 Oct 2024 11:10:35 +0000 (13:10 +0200)]
tools/toolbox: Small refactor
Handing the various options to different meson commands in meson-build
gets a bit tedious. Instead of handling them all on the toplevel,
split out *_command() functions that generate the commandline for
the corresponding meson command.
That way, options are handled locally where they matter, which
makes future changes and additions a bit easier.
Daniel van Vugt [Thu, 26 Sep 2024 10:26:21 +0000 (18:26 +0800)]
st/theme-node-drawing: Trace the correct path for inset box shadows
Previously we just copied the outer path and scaled it down, but that
resulted in an inconsistent thickness at the corners because the pivot
points for the arcs also moved inward.
So now we trace the inset path explicitly to maintain the correct
thickness (spread) around all the corners.
The spec actually mentions you need to do it in section 6.1 [1]:
> Note that for inner shadows, expanding the shadow (creating more
> shadow area) means contracting the shadow’s perimeter shape.
Despite the fact the example diagram gets it wrong in section 6.1.1 [2],
it does then follow with more confirmation that the shadow radius should
be reduced:
> To preserve the box’s shape when spread is applied, the corner radii
> of the shadow are also increased (decreased, for inner shadows) from
> the border-box (padding-box) radii by adding (subtracting) the spread
> distance (and flooring at zero).